import request from '@/utils/request'

/**
 *
 * @params{
    "id": 0,
    "mobile": "",
    "name": "",
    "password": "",
    "role": 0,
    "username": ""
  }
 */
// 添加用户
export function addUser(data) {
  return request({
    url: '/admin/user/insert-user',
    method: 'post',
    data
  })
}
/**
 *
 */
// 删除用户
export function deleteUserById(data) {
  return request({
    url: '/admin/user/delete',
    method: 'post',
    data
  })
}

// 批量删除用户
export function deleteUserList(data) {
  return request({
    url: '/admin/user/delete/batch',
    method: 'post',
    data
  })
}
/**
 *
 * @params{
	"id": 0,
	"mobile": "",
	"name": "",
	"password": "",
	"role": 0,
	"username": ""
}
 */
// 修改用户
export function updateUser(data) {
  return request({
    url: '/admin/user/update',
    method: 'post',
    data
  })
}
/**
 *
 * @params{
   "name": "",
   "pageNo": 0,
   "pageSize": 0
 }
 */
// 查询用户
export function getUserList(data) {
  return request({
    url: '/admin/user/list',
    method: 'post',
    data
  })
}
